﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace MVC2_Test.Models
{
    [Table(Name = "Bid")]
    public class Bid
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        internal int BidID { get; set; }

        [Column]
        internal int ItemID { get; set; }

        [Column]
        public DateTime DatePlaced { get; internal set; }

        [Column]
        public decimal BidAmount { get; internal set; }

        [Column]
        internal int MemberID { get; set; }

        internal EntityRef<Member> _member;
        [Association(ThisKey = "MemberID", Storage = "_member")]
        public Member Member
        {
            get { return _member.Entity; }
            internal set { _member.Entity = value; MemberID = value.MemberID; }
        }
    }
}